Project:Support desk

About this board

Welcome to the MediaWiki Support desk. This is a place where you can ask any questions you have about installing, using or administrating the MediaWiki software.

(Read this message in a different language)

See also

Before you post

Post a new question

  1. To help us answer your questions, please indicate which version of MediaWiki you are using, as found on your wiki's Special:Version page:
  2. If possible, add $wgShowExceptionDetails = true;error_reporting( -1 );ini_set( 'display_errors', 1 ); to LocalSettings.php in order to make MediaWiki show more detailed error messages.
  3. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  4. To start a new thread, click the box with the text "Start a new topic".

remove personal identifiable information

1
Luciferindcok21 (talkcontribs)

How to remove personal identifiable information from a given user.Is there any extensions similar to Extension:RemovePII . How to get the RemovePII for mediawiki 1.39, the default download is compatible only with mediawiki 1.41

Reply to "remove personal identifiable information"

$wgUsePathInfo A problem by any definition

3
77.127.126.137 (talkcontribs)

MediaWiki ver 1.41

I had this problem shown here:

Topic:Xmvyl460z5y8k72q

So as written there I set $wgUsePathInfo = false; and that solved it

But then we get this problem:

Topic:X7zabcz2fkhb68rs

And here they write that the solution to this is: $wgUsePathInfo=true;

What to do? Is there a way to solve this?

Osnard (talkcontribs)
77.127.126.137 (talkcontribs)

I don't have this word in the LocalSettings folder

I didn't have wgUsePathInfo either until this problem

Reply to "$wgUsePathInfo A problem by any definition"
2003:C2:3F21:FD00:516D:5391:79D1:A338 (talkcontribs)

Where shall I place my css modifications for the new Vector (2022) skin? I've tried MediaWiki:Vector-2022.css

but it has no effect.

Ciencia Al Poder (talkcontribs)

It may take some time to take effect, usually 20 minutes at most. Otherwise, a syntax error in that page may render the entire CSS or from one point to the end unusable. For example, if you forgot to open or close curly braces. You may want to check if the CSS of that page is valid running it through an online CSS validator.

2003:C2:3F21:FD00:48AC:4A02:818F:D381 (talkcontribs)

Sorry, no, there must be another reason. The same css code works fine as "User:MyUser/vector-2022.css" and does not work as "MediaWiki:Vector-2022.css"

Any other ideas? It is Mediawiki 1.39.6

Ciencia Al Poder (talkcontribs)

$wgUseSiteCss may be false, it fails only on restricted pages and $wgAllowSiteCSSOnRestrictedPages is false, or MediaWiki:Vector-2022.css or MediaWiki:Common.css (!) contains other CSS with syntax errors that renders the entire CSS unparseable (since both stylesheets are concatenated together).

Check also the browser's developer console

Reply to "css for Vector-2022"

1.39 how to setup mobile skin?

3
2003:C2:3F21:FD00:9449:AC0F:F20E:94B7 (talkcontribs)

Mediawiki 1.39.6, PHP 7.4.3, MySQL 8.0.36

wfLoadExtension( 'MobileDetect' );
wfLoadExtension( 'MobileFrontend' );
wfLoadSkin( 'MinervaNeue' );
$wgMFDefaultSkinClass = 'SkinMinerva';
$wgDefaultMobileSkin = 'MinervaNeue';
$wgMinervaEnableSiteNotice = true;
$wgMFAutodetectMobileView = true;
$wgMFEditorOptions = array(
        'anonymousEditing' => false,
        'skipPreview' => false
);


Till 1.35 we used to have MinervaNeue as mobile skin. With 1.39, this doesn't work anymore. Mobile devices apparently use the vector skin. What will i have to do to make the mobile skin work?

The mediawiki logfile is full of thousands of lines which don't say nothing to me, by filtering "mobile" i found one interesting line:

[resourceloader] Module "ext.MobileDetect.mobileonly" not loadable on target "mobile".

???

Bawolff (talkcontribs)

Do you have the correct versions of all your extensions? You need 1.39 version of Minerva and MobileFrontend etc.

2003:C2:3F21:FD00:E5D4:4DFC:FAFA:3692 (talkcontribs)

I am quite sure. MobileDetect 2.2 (fc3a66e) 18:49, 11. Feb. 2024, MobileFrontend 2.4.0 (7dc20b0) 07:36, 4. Mär 2024, MinervaNeue – (d515f6a) 08:24, 29. Apr. 2024

These are the versions I get when using ExtensionDistributor and SkinDistributor using target "1.39"

In the desktop browser, skin MinervaNeue has got the look. After login, of course. On my mobile, the skin is s.th. like vector, whether I am logged in or not. This means even when I select MinervaNeue in my user preferences!

Certainly the problem is sitting here in front of my screen, but I've got no more ideas where to look.

Reply to "1.39 how to setup mobile skin?"

Reinstalled MySQL and can't find a way to put Mediawiki database back in place from backup

2
Giovata (talkcontribs)

I was having trouble with my MySQL installation on an Ubuntu server where I host a Mediawiki. After hours of trying to research how to fix it, it seemed my only choice was to purge remove MySQL and then install it again. Eventually this worked and now MySQL runs correctly again.

Before doing this, I backed up /var/lib/mediawiki and /var/lib/mysql/ by coping those directories. Now that I've reset mysql, I've not been able to figure out a way to put the data back in place using the backup of .frm and .ibm files. I copied them back into place after creating a new empty MySQL database for the wiki, but it doesn't automatically import the data from these files and I can't find much information online that indicates how to do it in a situation like this. Guides for importing a Mediawiki backup all seem related to XML and other formats which I don't have.

I also don't want to fully reset my Mediawiki installation if that's possible, I would just like to configure it (or MySQL) in a way where I can make it work again using the backup files. update.php also can't run due to missing tables, and the wiki itself doesn't currently work at all without the database containing the data it needs.

What can I do to sort this out and make it work again with the pre-existing data?

Bawolff (talkcontribs)
Reply to "Reinstalled MySQL and can't find a way to put Mediawiki database back in place from backup"

Allow account creation only from specific email domains.

6
MarkJurgens (talkcontribs)

I'd like to allow teachers from my school board to create an account on our wiki, but ONLY if they have an email addresses from a specific domain. (Ex. ___@schoolboard.com). The end result would be only teachers from specific school boards would be able to create accounts and edit.

An array to add multiple school board domains would be great.

Any ideas? Thanks!

MarkAHershberger (talkcontribs)

This is easy to do by using the AbortNewAccount hook. Something like the following (untested, but based on code I use):

function abortOnBadDomain($user, &$message) {
	global $wgRequest;
	$allowedDomains = array( "school.edu", "k12.us" );
	$email = $wgRequest->getText( 'wpEmail' );
	$emailSplitList = explode("@", $email, 2);

	if ( isset( $emailSplitList[1] ) ) {
		foreach( $allowedDomains as $domain ) {
			if ( $emailSplitList[1] === $domain ) ) {
				return true;
			}
		}
	}
	$message = "Domain blocked";

	return false;
}
$wgHooks['AbortNewAccount'][] = 'abortOnBadDomain';
MarkJurgens (talkcontribs)

Thanks Mark,

I may have sounded like a programmer in my initial request, and I've got a good handle on configuring Mediawiki, so excuse my ignorance:

Where do I put this code?

On another note, are there a way to find a coder(s) who might want to help me with an educational project? I can float server costs but developer might tank my non-existent budget. :)

Thanks again! P.s. Nice blog.

MarkAHershberger (talkcontribs)

You can put the code at the bottom of your LocalSettings.php file. It should work there. Let me know if you run into problems with it.

I'm not sure how to find a volunteer coder, but you might find someone who has some interest, or who can offer you pointers by writing about your project on mail:mediawiki-l.

Thanks!

FabienAndre (talkcontribs)

Due to the deprecation of AbortNewAccount hook, the previous the previous answer from @MarkAHershberger does not work anymore (so as the EmailDomainCheck extension).

Here is an updated version that you can include in LocalSettings.php (tested on 1.41)

class AllowedDomainPreAuthenticationProvider extends \MediaWiki\Auth\AbstractPreAuthenticationProvider {
    public function testForAccountCreation( $user, $creator, array $reqs ) {
        $allowedDomains = array( "school.edu", "k12.us" );
        $email = $user->mEmail;
        $emailSplitList = explode("@", $email, 2);

        if ( isset( $emailSplitList[1] ) ) {
            foreach( $allowedDomains as $domain ) {
                if ( $emailSplitList[1] === $domain ) {
                    return \StatusValue::newGood();
                }
            }
        }

        $message = "Blocked domain ($emailSplitList[1]). Allowed domains are : " . implode(', ', $allowedDomains);
        return \StatusValue::newFatal($message);
    }
}

$wgAuthManagerAutoConfig['preauth'] = [
    'AllowedDomainPreAuthenticationProvider' => [
        'class' => 'AllowedDomainPreAuthenticationProvider',
        'sort' => 1,
    ],
];
Reply to "Allow account creation only from specific email domains."

implement 2 potentially useful functions

1
185.169.64.46 (talkcontribs)

1. As you will already know, to put a link that shows the logs of a page (let's say the "Example" page), we have to write "https://mediawiki.org/wiki/Special:log?page=Example", "[/mediawiki.org/wiki/special:log?page=example]" or "{{fullurl:special:log|page=example}}", I would suggest that just writing "{{Special:log|page=example}}", instead of ignoring any character after the pipe/vertical bar ("|"), have it (into account) as a parameter separator like "{{Special:Prefixindex/Editnotices|namespace=10|stripprefix=1}}" does, not only on that special log page, but also on any other special page. 2. We can write [[Special:Log/create]] rather than "https://mediawiki.org/wiki/Special:Log/create" or "https://mediawiki.org/w/index.php?title=Special:Log&type=create" to view log of pages created, but with subtypes of a log type cannot use double square brackets, if we want to see the page restoration logs, we have to write obligatory "https://mediawiki.org/wiki/Special:log/delete?subtype=restore" or "{{fullurl:Special:Log/delete|subtype=restore}}", if "delete" or any other type of log (that has subtypes), is not added, the subtype is simply ignored, but that has nothing to do with this 2nd implementation, I suggest that the system can show the same page logs when instead of having "?subtype=<name of a subtype log>" in the URL it had "/<name of a subtype log>", the shortest URL to display restore logs would be "https://mediawiki.org/wiki/Special:log/delete/restore" instead of "https://mediawiki.org/wiki/Special:log/delete?subtype=restore", so, we could go to that page by just typing "[[Special:log/delete/restore]]" instead of having to type the full URL or using "{{fullurl}}", and furthermore, with that implementation, we could also see Pppery's modified block logs writing "[[Special:Log/block/reblock/Pppery]]" instead of "{{fullurl:Special:Log/block/Pppery|subtype=reblock}}", It would also be valid to write "https://mediawiki.org/wiki/special:log?type=block/reblock"

If they are implemented, we would save ourselves from writing full URLs or using {{fullurl}}

Reply to "implement 2 potentially useful functions"

Subpages Not Allowed?

1
Johnywhy (talkcontribs)

On import, i'm getting

Wrong option: Namespace "(Main)" of the root page does not allow subpages.

How to fix?

Manual:Importing XML dumps

Reply to "Subpages Not Allowed?"

List of hidden special pages

4
Zhuyifei1999 (talkcontribs)
MarkAHershberger (talkcontribs)

There is this list in SpecialPageFactory.php:

		// Unlisted / redirects
		'Blankpage'                 => 'SpecialBlankpage',
		'Blockme'                   => 'SpecialBlockme',
		'Emailuser'                 => 'SpecialEmailUser',
		'Movepage'                  => 'MovePageForm',
		'Mycontributions'           => 'SpecialMycontributions',
		'Mypage'                    => 'SpecialMypage',
		'Mytalk'                    => 'SpecialMytalk',
		'Myuploads'                 => 'SpecialMyuploads',
		'PermanentLink'             => 'SpecialPermanentLink',
		'Redirect'                  => 'SpecialRedirect',
		'Revisiondelete'            => 'SpecialRevisionDelete',
		'Specialpages'              => 'SpecialSpecialpages',
		'Userlogout'                => 'SpecialUserlogout',
104.218.129.50 (talkcontribs)

You forgot Special:Mobile languages and Special:MyLanguage.

Reply to "List of hidden special pages"

Unable to Delete Files

2
72.23.146.10 (talkcontribs)

Howdy,

I'm trying to delete some duplicated images, but keep getting the following error:

Error deleting file: An unknown error occurred in storage backend "local-backend".

The images in question all have previous versions that, for one reason or another, show "No thumbnail" as their first version (despite those thumbnails existing previously, prior to new versions being uploaded). Images that don't have "No thumbnail" as their first record can be deleted without issue.

My biggest question is, is there a way to bypass this error and delete the files? Less importantly, what can cause the "No thumbnail" issue to happen? The wiki I'm working on has lost a lot of prior versions of images over the years and no one can pinpoint why, or how to prevent it from happening in the future.

TheDJ (talkcontribs)

Most often this is due to permissions on the filesystem being incorrect. the webserver deamon and the permissions of the directory have to be compatible.

Reply to "Unable to Delete Files"